import { atom } from "jotai";

export interface ResultItemType {
	path: string;
	targetInd: number;
	is_del?: boolean;
}

export interface WorkItemType {
	icon: {
		icon_all: string;
	};
	id: number;
	json_content: {
		cn: {
			title: string;
			desc: string;
		};
		custom_title?: string;
		custom_desc?: string;
	};
	result_json: ResultItemType[];
	columnCount: number;
	createtime: number;
}

export interface PageParamsType {
	pagesize: number;
	page: number;
}

// 作品列表
export const workListAtom = atom<WorkItemType[]>([]);
// 页码参数
export const pageParamsAtom = atom<PageParamsType>({
	pagesize: 20,
	page: 1,
});
// 标记作品列表是否为空
export const currentWorkListAtom = atom<boolean>(false);
